package com.qidian.by.goods.controller;

import com.qidian.by.goods.service.IItemSpecificationItemService;
import com.qidian.by.pojo.goods.entity.ItemSpecificationItem;
import com.qidian.by.util.pojo.EsResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小可怎么都睡不够
 * @since 2024-05-08
 */
@RestController
@RequestMapping("/speItem")
public class ItemSpecificationItemController {
    @Autowired
    private IItemSpecificationItemService speItemService;

    @GetMapping("/list")
    public EsResult list(Long speId){
        return speItemService.list(speId);
    };
    @PostMapping("/save")
    public EsResult save(@RequestBody ItemSpecificationItem itemSpecificationItem){
        return speItemService.save(itemSpecificationItem);
    }

//    查找该商品没有设置的规格
    @GetMapping("/list/notAt")
    public EsResult listByItemId(Long itemId){
        return speItemService.queryByItemIdByNotAt(itemId);
    }
}
